import { FormattedMessage, getLocale, setLocale, useAccess, useModel } from 'umi';

export default function HomePage() {
  const { initialState } = useModel('@@initialState');

  const access = useAccess();

  console.log(access);
  console.log(initialState);

  function divHandle() {
    setLocale(getLocale() === 'zh-US' ? 'zh-CN' : 'zh-US', false);
  }

  return (
    <>
      <div onClick={divHandle}>
        <FormattedMessage id="welcome" />
      </div>
      <ul>
        <li>1</li>
        <li>1</li>
        <li>1</li>
        <li>1</li>
      </ul>
    </>
  );
}
